'use strict'
module.exports = (sequelize, DataTypes) => {
  return sequelize.define('wx_user', {
    open_id: {
      type: DataTypes.STRING(100),
      primaryKey: true,
      allowNull: false
    },
    uuid: {
      type: DataTypes.STRING(100),
      allowNull: false
    },
    skey: {
      type: DataTypes.STRING(100),
      allowNull: false
    },
    create_time: {
      type: DataTypes.DATE,
      defaultValue: DataTypes.NOW,
      allowNull: false
    },
    last_visit_time: {
      type: DataTypes.DATE,
      defaultValue: DataTypes.NOW,
      allowNull: false
    },
    session_key: {
      type: DataTypes.STRING(100),
      allowNull: false
    },
    user_info: {
      type: DataTypes.STRING(2048),
      allowNull: false
    }
  })
}
